<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
<script>function isString(value) {  return Object.prototype.toString.call(value)==="[object String]";}
        console.log(isString("a"))
        console.log(isString(1))
        console.log(isString(false))
        console.log(isString(new String("aa")))
        console.log(isString2(false))
        console.log(isString2(1))
        console.log(isString2("a"))
        console.log(isString2(new String("aa")))
        console.log(asd)
        let asd = 123
        function isString2(value){
            return typeof value =="string" 
        }

        /** * *  给出一颗树节点定义如下： * *  interface TreeNode { *    value: any *    left?: TreeNode *    right?: TreeNode *  } * 
         * *  要求，获取二叉树的深度，例如：如下树深度为 3 * *       3 *      / \ *      9  20 *        /  \ *      15   7 * **
         * /*/
         function maxDepth(treeNode) {  //在这里实现
            var depth = 1;
            if(!treeNode){return 0}
        
            var ld = maxDepth(treeNode.left)
            var rd = maxDepth(treeNode.right)
            return ld>rd ? depth+ld:depth+rd


        }
</script>
</body>
</html>